package com.china.produce.config.rabbitmq;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName
 * @Author niujie
 * @Version
 * @Description
 * @CreateTime 2022/1/28
 */
@Configuration
public class DeadTopicConfig {

    @Bean
    public TopicExchange deadTopicExchange()
    {
        return new TopicExchange("dead_topic_exchange", true, false);
    }

    @Bean
    public Queue deadTopicQueue()
    {
        return new Queue("dead.topic.queue", true);
    }

    @Bean
    public Binding bindingDeadTopic()
    {
        return BindingBuilder.bind(deadTopicQueue()).to(deadTopicExchange()).with("topic.msg");
    }
}
